<% title_tag [params[:q], t('common.search_result')].join(' · ') %>

<div class="search-results card">
  <div class="card-header clearfix">
    <div class="text-mutted">关于 “<%= params[:q] %>” 的搜索结果, 共 <%= @result.records.total %> 条</div>
  </div>

  <div class="card-body">
    <% if @result.records.total == 0 %>
      <div class="no-result">没有搜索到任何有关 “<%= params[:q]%>” 的内容</div>
    <% else %>
      <% @result.records.each_with_hit do |item, hit| %>
        <% partial_view_name = item.class.name.downcase -%>
        <%= render partial: (partial_view_name == 'team' ? 'user' : partial_view_name), locals: { item: item, hit: hit } %>
      <% end %>
    <% end %>
  </div>

  <div class="card-footer clearfix">
    <%= paginate @result %>
  </div>
</div>
